package com.zhuss.product.processor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import com.zhuss.bean.vo.product.hotLine.DetailHotLineVo;
import com.zhuss.enums.StartStopEnum;
import com.zhuss.exception.DzcxException;


@Component("hotLineCheck")
public class HotLineCheck {
	
	@Autowired
	@Qualifier("hotLineRead")
	private HotLineRead hotLineRead;

	
	public boolean checkStart(Long hotLineId) throws DzcxException {
		DetailHotLineVo hotLine = ((DetailHotLineVo) hotLineRead.detail(hotLineId));
		if (StartStopEnum.停用.sameKey(hotLine.getStatus())) {
			return true;
		}
		return false;
	}
	
	public boolean checkStop(Long hotLineId) throws DzcxException {
		DetailHotLineVo hotLine = ((DetailHotLineVo) hotLineRead.detail(hotLineId));
		if (StartStopEnum.启用.sameKey(hotLine.getStatus())) {
			return true;
		}
		return false;
	}
	
}
